package com.cs157a.view;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.ArrayList;
import javax.swing.JPanel;
import javax.swing.JSplitPane;

import com.cs157a.controller.AposApplicationController;
import com.cs157a.dao.RdiPart;

/**
 * This class is the outer panel on the righjt of the main view that contains
 * the part summary and part detail panels.
 * 
 * @author hhong
 * 
 */
public class ContentPanel extends JPanel {

	private static final long serialVersionUID = 20012100301L;

	private AposApplicationController controller;

	private JSplitPane splitPane;
	private PartSummaryPanel partSummaryPanel;
	private PartDetailPanel partDetailPanel;

	public ContentPanel(AposApplicationController controller) {
		super();
		this.controller = controller;

		init();
	}

	private void init() {
		partSummaryPanel = new PartSummaryPanel(controller,
				new ArrayList<RdiPart>());
		partDetailPanel = new PartDetailPanel(controller);

		splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, partSummaryPanel,
				partDetailPanel);
		splitPane.setDividerLocation(210);
		splitPane.setOneTouchExpandable(true);
		splitPane.setResizeWeight(0.3);

		Dimension minimumSize = new Dimension(200, 100);
		partSummaryPanel.setMinimumSize(minimumSize);
		partDetailPanel.setMinimumSize(minimumSize);

		setLayout(new BorderLayout());
		add(splitPane, BorderLayout.CENTER);

	}


    

}
